/*
 * File:   Node.h
 * Authors: bnoleau, cybourdi, rlecrois
 *
 * Created on 18 octobre 2011, 10:58
 */

#ifndef NODE_H
#define	NODE_H

#include "builder/Builder.h"
#include "list"

#include <iostream>


using namespace std;

class Node {
public:
    Node();
    Node(int nodeID);
    virtual ~Node();

    int getID();
    list<Node*> *getEdgeList();

    void setID(int new_nodeID);
    void toString(ostream &flux) ;
    int outDeg();
    void addEdge(Node* n);
	bool isLeaf();
	bool isRoot();
	bool hasEdgeWith(Node* n2);
	void build(Builder *b);

    bool eq(const Node &n2) const;
    bool lt(const Node &n2) const;

private:
    int nodeID;
    list<Node*> *edgeList;
    void init(int nodeID);
};

ostream &operator<<( ostream &flux, Node& node);
bool operator<(Node const &n1, Node const &n2);
bool operator==(Node const &n1, Node const &n2);
bool operator!=(Node const &n1, Node const &n2);


#endif	/* NODE_H */

